/*
-------------------------------------------------

	OGG.h

	Dmitriy Kuzmenko (Dgut)

-------------------------------------------------
*/

#ifndef __AUTUMN_OGG_H__
#define __AUTUMN_OGG_H__

#include "OpenAL.h"
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>

namespace Autumn
{

class OGG
{
	OggVorbis_File				file;
	int							channels;
	long						rate;
	ogg_int64_t					size;
	char *						data;
public:
								OGG( const char * fileName, bool streamed = false );
								~OGG( void );

	const long					Read( char * buffer, long size );
	void						Rewind( void );

	inline const int			GetChannels( void ) const;
	inline const long			GetRate( void ) const;
	inline const ogg_int64_t	GetSize( void ) const;
	inline char * const			GetData( void ) const;
};

inline const int OGG::GetChannels( void ) const
{
	return channels;
}

inline const long OGG::GetRate( void ) const
{
	return rate;
}

inline const ogg_int64_t OGG::GetSize( void ) const
{
	return size;
}

inline char * const OGG::GetData( void ) const
{
	return data;
}

}	// namespace Autumn

#endif	// !!! __AUTUMN_OGG_H__ !!!